//
//  String.UrlEncode.swift
//  App_Common_FoundationExtensions
//
//  Created by 蒋晨成 on 2022/2/7.
//

import Foundation

public extension String {
    func urlEncode() -> String {
        addingPercentEncoding(withAllowedCharacters: .urlHostAllowed) ?? ""
    }

    func urlDecode() -> String? {
        removingPercentEncoding
    }
}
